<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
	<f:view>
		<h:form id='form'>
			<head>
	<f:loadBundle basename="messages" var="msgs" />
	<title><h:outputText value="#{msgs.title}" /></title>
	<style type="text/css" title="currentStyle">
		@import "${facesContext.externalContext.requestContextPath}/views/css/theme.css";
	</style>
	<script type="text/javascript" src="../../resources/script/jquery.js"></script>
	<script type="text/javascript">
		$(document).ready(function () {
		var flag = $('[id="form:user_flag"]' );
		var flagLabel = $('[id="form:flag_label"]' );
			flag.click(function(){
				if(flag.is(':checked'))
				{
					flagLabel.text("Disabled");
				}
				else
				{
					flagLabel.text("Enabled");
				}
			});
		})
		
		</script>

		</head>
		<body>
			<ui:include src="../header/header.xhtml" />

			<br />
			<br />
			<br />

			<h:outputText value="#{msg.user_title}" />

			<p></p>


			<div id="div">
				<table class="display" id="user_table">
					<tr>
						<td><h:outputLabel value="#{msg.username}"></h:outputLabel></td>
						<td><h:outputLabel value="#{user.username}">
							</h:outputLabel></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.password }">
							</h:outputLabel></td>
						<td><h:inputSecret value="#{user.password }">
							</h:inputSecret></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.email}"></h:outputLabel></td>
						<td><h:inputText value="#{user.email}"></h:inputText></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.address }"></h:outputLabel></td>
						<td><h:inputText value="#{user.address }"></h:inputText></td>
					</tr>


					<tr>
						<td><h:outputLabel value="#{msg.postaddress }"></h:outputLabel>
						</td>
						<td><h:inputText value="#{user.postAddress }"></h:inputText>
						</td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.mobile }"></h:outputLabel></td>
						<td><h:inputText value="#{user.mobile }"></h:inputText></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.phone }"></h:outputLabel></td>
						<td><h:inputText value="#{user.phone }"></h:inputText></td>
					</tr>

					<tr>
						<td><h:outputLabel id="flag_label" value="#{msg.enable }"></h:outputLabel>
						</td>
						<td><h:selectBooleanCheckbox id="user_flag"
								value="#{user.enabled}">
							</h:selectBooleanCheckbox></td>
					</tr>

					<tr>
						<td><h:outputLabel value="#{msg.registered_time }"></h:outputLabel>
						</td>
						<td><h:outputLabel value="#{user.registeredTime}">
							</h:outputLabel></td>
					</tr>

					<tr>
						<td>
							<h:commandButton value="#{msg.submit}"
								action="#{user.commitChangeAction }">
							</h:commandButton>
						</td>
						<td>
							<h:commandButton value="Back To Users"
								action="#{user.backToUserAction }">
							</h:commandButton>
						</td>
					</tr>

				</table>

			</div>

			<p></p>
			<ui:include src="../footer/footer.xhtml" />

		</body>
	</h:form>
</f:view>
</html>
